package com.example.backend.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 数据库优化配置
 * 提供JPA性能优化和查询优化
 * 注意：移除了自定义EntityManager配置以避免与Spring Boot自动配置冲突
 */
@Configuration
@EnableJpaRepositories(basePackages = "com.example.backend.repository")
@EnableTransactionManagement
@ConditionalOnProperty(name = "spring.jpa.optimization.enabled", havingValue = "true", matchIfMissing = false)
public class DatabaseOptimizationConfig {
    
    // 移除了自定义EntityManager配置，使用Spring Boot的自动配置
    // 性能优化配置通过application.properties文件进行配置
}
